package com.ruoyi.system.api.domain;

import io.swagger.annotations.ApiModel;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.List;

/**
 * 机构对象 sys_org
 * 
 * @author ruoyi
 * @date 2023-02-07
 */
/**
 * 机构对象 sys_org
 *
 * @author ruoyi
 * @date 2023-02-07
 */
@ApiModel("机构对象")
public class SysOrg extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 机构名称
     */
    @NotNull(message = "机构名称不能为空")
    @Excel(name = "机构名称")
    private String orgName;

    /**
     * 机构所在的县区
     */
    @NotNull(message = "县区不能为空")
    @Excel(name = "机构所在的县区")
    private Long provinceCode;

    /**
     * 机构所在城市编码
     */
    @NotNull(message = "城市不能为空")
    @Excel(name = "机构所在的城市编码")
    private Long cityCode;


    @NotNull(message = "地区不能为空")
    @Excel(name = "机构所在地区编码")
    private Long areaCode;

    private String cityName;

    /**
     * 公司地址
     */

    @Excel(name = "公司地址")
    private String orgAddress;

    /**
     * 法人姓名
     */
    @Excel(name = "法人姓名")
    private String personName;

    /**
     * 法人联系方式
     */
    @Excel(name = "法人联系方式")
    private String personPhonenumber;

    /**
     * 业务联系人
     */
    @Excel(name = "业务联系人")
    private String busName;

    /**
     * 业务联系人电话
     */
    @Pattern(regexp = "(\\d{11})|^((\\d{7,8})|(\\d{4}|\\d{3})-(\\d{7,8})|(\\d{4}|\\d{3})-(\\d{7,8})-(\\d{4}|\\d{3}|\\d{2}|\\d{1})|(\\d{7,8})-(\\d{4}|\\d{3}|\\d{2}|\\d{1}))$")
    @Excel(name = "业务联系人电话")
    private String busPhonenumber;

    /**
     * 公司邮箱
     */
    @Email(message = "邮箱格式不正确")
    @Excel(name = "公司邮箱")
    private String orgEmail;

    /**
     * 公司传真
     */
    @Excel(name = "公司传真")
    private String orgFax;

    /**
     * 纳税人识别号
     */
    @Excel(name = "纳税人识别号")
    private String taxpayerNumber;

    /**
     * 银行账号
     */
    @Excel(name = "银行账号")
    private String bankNumber;

    /**
     * 开户行
     */
    @Excel(name = "开户行")
    private String bankName;

    /**
     * 发票类型 0=增值税普通发票 1=增值税专用发票
     */
    @Excel(name = "发票类型 0=增值税普通发票 1=增值税专用发票")
    private Integer invoiceType;

    /**
     * 发票点数
     */
    @Excel(name = "发票点数")
    private String invoiceCount;

    @Size(max = 15)
    private String userName;

    // 机构关键字
    @NotNull(message = "机构关键字不能为空")
    private String keyWord;

    private String keyWord1;

    private Long[] jclbIds;

    private List<SysOrgCertificate> sysOrgCertificateList;

    public List<SysOrgCertificate> getSysOrgCertificateList() {
        return sysOrgCertificateList;
    }

    public void setSysOrgCertificateList(List<SysOrgCertificate> sysOrgCertificateList) {
        this.sysOrgCertificateList = sysOrgCertificateList;
    }

    public String getOrgName() {
        return orgName;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    public void setOrgAddress(String orgAddress) {
        this.orgAddress = orgAddress;
    }

    public String getOrgAddress() {
        return orgAddress;
    }

    public void setPersonName(String personName) {
        this.personName = personName;
    }

    public String getPersonName() {
        return personName;
    }

    public void setPersonPhonenumber(String personPhonenumber) {
        this.personPhonenumber = personPhonenumber;
    }

    public String getPersonPhonenumber() {
        return personPhonenumber;
    }

    public void setBusName(String busName) {
        this.busName = busName;
    }

    public String getBusName() {
        return busName;
    }

    public void setBusPhonenumber(String busPhonenumber) {
        this.busPhonenumber = busPhonenumber;
    }

    public String getBusPhonenumber() {
        return busPhonenumber;
    }

    public void setOrgEmail(String orgEmail) {
        this.orgEmail = orgEmail;
    }


    public String getOrgEmail() {
        return orgEmail;
    }

    public void setOrgFax(String orgFax) {
        this.orgFax = orgFax;
    }

    public String getOrgFax() {
        return orgFax;
    }

    public void setTaxpayerNumber(String taxpayerNumber) {
        this.taxpayerNumber = taxpayerNumber;
    }

    public String getTaxpayerNumber() {
        return taxpayerNumber;
    }

    public void setBankNumber(String bankNumber) {
        this.bankNumber = bankNumber;
    }

    public String getBankNumber() {
        return bankNumber;
    }

    public void setBankName(String bankName) {
        this.bankName = bankName;
    }

    public String getBankName() {
        return bankName;
    }

    public void setInvoiceType(Integer invoiceType) {
        this.invoiceType = invoiceType;
    }

    public Integer getInvoiceType() {
        return invoiceType;
    }

    public void setInvoiceCount(String invoiceCount) {
        this.invoiceCount = invoiceCount;
    }

    public String getInvoiceCount() {
        return invoiceCount;
    }

    public Long getProvinceCode() {
        return provinceCode;
    }

    public void setProvinceCode(Long provinceCode) {
        if (provinceCode != null && provinceCode == -1){
            return;
        }
        this.provinceCode = provinceCode;
    }

    public Long getCityCode() {
        return cityCode;
    }

    public void setCityCode(Long cityCode) {
        if (cityCode != null && cityCode == -1){
            return;
        }
        this.cityCode = cityCode;
    }

    public Long getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(Long areaCode) {
        if (areaCode != null && areaCode == -1){
            return;
        }
        this.areaCode = areaCode;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getKeyWord() {
        if(keyWord != null){
            if(keyWord.startsWith("、")){
                keyWord = keyWord.substring(1);
            }
            if(keyWord.endsWith("、")){
                keyWord = keyWord.substring(0,keyWord.length() - 1);
            }
        }
        return keyWord;
    }

    public void setKeyWord(String keyWord) {
        this.keyWord = keyWord;
    }

    public String getKeyWord1() {
        return keyWord1;
    }

    public void setKeyWord1(String keyWord1) {
        this.keyWord1 = keyWord1;
    }

    public Long[] getJclbIds() {
        return jclbIds;
    }

    public void setJclbIds(Long[] jclbIds) {
        this.jclbIds = jclbIds;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("orgId", getOrgId())
                .append("areaCode", getAreaCode())
                .append("orgAddress", getOrgAddress())
                .append("personName", getPersonName())
                .append("personPhonenumber", getPersonPhonenumber())
                .append("busName", getBusName())
                .append("busPhonenumber", getBusPhonenumber())
                .append("orgEmail", getOrgEmail())
                .append("orgFax", getOrgFax())
                .append("taxpayerNumber", getTaxpayerNumber())
                .append("bankNumber", getBankNumber())
                .append("bankName", getBankName())
                .append("invoiceType", getInvoiceType())
                .append("invoiceCount", getInvoiceCount())
                .append("createUserId", getCreateUserId())
                .append("createTime", getCreateTime())
                .toString();
    }
}

